#pragma once

namespace MomogenkyouSystem	{


class EffectParameter
{
protected:
	SHADEREFFECT	m_pParentEffect;
	std::string		m_Name;
	D3DXHANDLE		m_Handle;

public:
	EffectParameter();
	EffectParameter(SHADEREFFECT Parent, const std::string & Name);
	virtual ~EffectParameter();
	inline	std::string Name()	const {	return m_Name;	}

	inline	void	SetValue(const float & scalar)			{	m_pParentEffect->SetFloat(m_Handle,	scalar);			}
	inline	void	SetValue(float * scalar, size_t Count)	{	m_pParentEffect->SetFloatArray(m_Handle, scalar, Count);}
	inline	void	SetVector(const float4 & v)				{	m_pParentEffect->SetVector(m_Handle, &v);				}
	inline	void	SetVector(float4 *  v,	size_t Count)	{	m_pParentEffect->SetVectorArray(m_Handle, v, Count);	}
	inline	void	SetMatrix(MATRIX * m)					{	m_pParentEffect->SetMatrix(m_Handle, m);				}
	inline	void	SetMatrix(MATRIX * m, size_t Count)		{	m_pParentEffect->SetMatrixArray(m_Handle, m, Count);	}
	inline	void	SetTexture(TEXTURE texture)				{	m_pParentEffect->SetTexture(m_Handle, (texture));		}
};

//	Container that holds the main Effect
class	Shader
{
public:
	SHADEREFFECT	Effect;

	Shader();
	virtual	~Shader();

	EffectParameter	GetParameter(const std::string & ParamName);
	virtual	bool	Prepare(const std::string & Filename);
};
}